{loop $all $key $value}
<tr>
    <td>1</td>
    <td>{$value['couponname']}</td>
    <td>
        <a href="javascript:;" data-toggle="ajaxEdit"
           data-href="{php echo webUrl('exchange/coupon/stock',array('goodsid'=>$value['id']));}"
           style="display: inline;">{$value['id']}</a>
    </td>
    <td>
        <div class="onoffswitch">
            <input type="checkbox" name="checkbox[]"
                   class="onoffswitch-checkbox" id="no{$value['id']}"
                   value="{$value['id']}" {if $coupon!=null && in_array($value['id'],$coupon)}checked{/if}>
            <label class="onoffswitch-label" for="no{$value['id']}">
                <span class="onoffswitch-inner"></span>
                <span class="onoffswitch-switch"></span>
            </label>
        </div>
    </td>
</tr>
{/loop}
{loop $other $key $value}
<tr>
    <td>1</td>
    <td>{$value['couponname']}</td>
    <td>
        <a href="javascript:;" data-toggle="ajaxEdit"
           data-href="{php echo webUrl('exchange/coupon/stock',array('goodsid'=>$value['id']));}"
           style="display: inline;">{$value['id']}</a>
    </td>
    <td>
        <div class="onoffswitch">
            <input type="checkbox" name="checkbox[]"
                   class="onoffswitch-checkbox" id="no{$value['id']}"
                   value="{$value['id']}" {if $coupon!=null && in_array($value['id'],$coupon)}checked{/if}>
            <label class="onoffswitch-label" for="no{$value['id']}">
                <span class="onoffswitch-inner"></span>
                <span class="onoffswitch-switch"></span>
            </label>
        </div>
    </td>
</tr>
{/loop}